Skip to content

fixed isPlainObject.js #1005

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed

fixed isPlainObject.js #1005

wants to merge 1 commit into from

Conversation

alex89lj
Copy link

hi , I can't get the correct result when I use Object.create.
for example:isPlainObject(Object.create({})) => false

@markerikson
Copy link
Contributor

We only use this in a couple places in our codebase, and I can't see any reason why we would need to be concerned with use of Object.create() in this case. Appreciate the PR, but I don't think this is something we need to add.

@alex89lj
Copy link
Author

I am very happy to receive your reply.We use this method to detect the props passed by the user. Lodash can judge correctly. Why don't we make it better?

@markerikson
Copy link
Contributor

Because it's not meaningfully needed in this case.

It's used in verifyPlainObject, which is called here:

verifyPlainObject(mergedProps, displayName, 'mergeProps')

and here:

verifyPlainObject(props, displayName, methodName)

Both of those places are exceedingly unlikely to be dealing with an Object.create() call.

@alex89lj
Copy link
Author

Ok.thank you for your reply

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants